﻿; (function ($, window, document, undefined) {
    var myApp = window.myApp;
    var view = myApp.views.view;

    if (myApp.views.products == undefined)
        myApp.views.products = {};
    
    var writer = "@helper writeProduct(product) { <span>product name is [@product.name]</span> <a id='edit' href='#products/edit/@product.id'>Edit</a><br/> } ";

    myApp.views.products.index = writer + "@for (var i = 0; i < model.length; i++) { @writeProduct(model[i]) }";
})(jQuery, window, document);